/* -----------------------------------------------------------------------
 * Chris Lewis
 * CS 362
 * Assignment 3: cardtest1.c to test smithy card (refactored)
 *
 * cardtest1: cardtest1.c dominion.o rngs.o
 *      gcc -o cardtest1 -g  cardtest1.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define NOISY_TEST 1

int main() {
    int r;
    int seed = 1000;                                                                            //initiate a two player game
    int numPlayer = 2;
    int pos = 1;
    int k[10] = {adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall};
    int bonus = 0;
    struct gameState G;
    int startingHandCount;
    int s;

    r = initializeGame(numPlayer, k, seed, &G);
    startingHandCount = G.handCount[0];

    printf("\n\n********* TESTING SMITHY ************\n");
    
#if (NOISY_TEST == 1)
    printf ("initializeGame(%d, k, 1, &G) = %d\n", numPlayer, r);
#endif
    assert(r == 0);
                                             
#if (NOISY_TEST == 1)
     printf("Beginning # of cards in hand: %d\n", startingHandCount);
#endif
        
    puts("playing smithy");
    s = cardEffect(smithy, 0, 0, 0, &G, pos, &bonus);                //play smithy card, should add 3 cards then discard 1 card for total count change of +2 cards
    assert(s == 0);
    assert(G.handCount[0] == startingHandCount + 2);                //check against starting hand count

#if (NOISY_TEST == 1)
     printf("Ending # of cards in hand: %d\n", G.handCount[0]);
#endif

    printf("smithy card: PASS\n");

    return 0;
}